﻿using System;
using System.Collections.Generic;
using System.Web.Http;
using Smatime.Web.DAO;
using Smatime.Web.Models;

namespace Smatime.Web.Controllers
{
    public class WorkTimeOfStaffsController : ApiController
    {
        // GET api/worktimeofstaffs
        public IEnumerable<string> Get()
        {
            return new[] {"value1", "value2"};
        }

        // GET api/worktimeofstaffs/5
        [Route("api/worktimeofstaffs/id/{id}/DateForm/{dateForm}/DateTo/{dateTo}")]
        public IEnumerable<WorkTimeOfStaffs> Get(int id, DateTime dateForm, DateTime dateTo)
        {
            return new WorkTimeOfStaffsRepository().GetTotalWorkByCompanyId(id, dateForm, dateTo);
        }

        [Route("api/worktimeofstaffs/id/{id}/StoreName/{storeName}/DateForm/{dateForm}/DateTo/{dateTo}")]
        public IEnumerable<WorkTimeOfStaffs> Get(int id, string storeName, DateTime dateForm, DateTime dateTo)
        {
            return new WorkTimeOfStaffsRepository().GetTotalWorkByStoreName(id, storeName, dateForm, dateTo);
        }

        [Route("api/worktimeofstaffs/id/{id}/ClosingDay/{closingDay}")]
        public IEnumerable<WorkTimeOfStaffs> Get(int id, string closingDay)
        {
            return new WorkTimeOfStaffsRepository().GetStaffByClosingDay(id, closingDay);
        }

        // POST api/worktimeofstaffs
        public void Post([FromBody] string value)
        {
        }

        // PUT api/worktimeofstaffs/5
        public void Put(int id, [FromBody] string value)
        {
        }

        // DELETE api/worktimeofstaffs/5
        public void Delete(int id)
        {
        }
    }
}